<?php

namespace app\controller\v1;
error_reporting(E_ALL);
ini_set('display_errors', 1);
use app\BaseController;
use app\common\Send;
use app\service\UploadService;

class Upload extends BaseController
{
    use Send;

    protected $uploadService;

    public function __construct(UploadService $uploadService)
    {
        $this->uploadService = $uploadService;
    }

    public function upload()
    {
        $flie = request()->file("file");
        $result = $this->uploadService->upload($flie);
        return self::success($result);
    }
}
